package com.retail.shopping.remote.factory;

import com.retail.common.core.domain.Result;
import com.retail.product.common.domain.TSku;
import com.retail.shopping.remote.ProductFeign;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 功能描述:
 *
 * @version: java version 1.8
 * @author: liguangyao
 * @date: 2024-02-27 下午 8:07
 */
@Component
public class ProductFallbackFactory implements FallbackFactory<ProductFeign> {
    @Override
    public ProductFeign create(Throwable cause) {
        return new ProductFeign () {
            @Override
            public Result<TSku> skuFindId(Long cartId) {
                return Result.error ("sku信息获取失败请联系管理员我在商品列表中");
            }

            @Override
            public Result orderSkuUpdNumber(String str, String number) {
                return Result.error ("错误");
            }
        };
    }
}
